0 Prolog
↳1 PrologToPiTRSProof (⇒, 59 ms)
↳2 PiTRS
↳3 DependencyPairsProof (⇔, 186 ms)
↳4 PiDP
↳5 DependencyGraphProof (⇔, 38 ms)
↳6 AND
↳7 PiDP
↳8 UsableRulesProof (⇔, 0 ms)
↳9 PiDP
↳10 PiDPToQDPProof (⇔, 0 ms)
↳11 QDP
↳12 QDPSizeChangeProof (⇔, 0 ms)
↳13 YES
↳14 PiDP
↳15 UsableRulesProof (⇔, 0 ms)
↳16 PiDP
↳17 PiDPToQDPProof (⇔, 0 ms)
↳18 QDP
↳19 QDPSizeChangeProof (⇔, 0 ms)
↳20 YES
↳21 PiDP
↳22 UsableRulesProof (⇔, 0 ms)
↳23 PiDP
↳24 PiDPToQDPProof (⇒, 0 ms)
↳25 QDP
↳26 MRRProof (⇔, 203 ms)
↳27 QDP
↳28 DependencyGraphProof (⇔, 0 ms)
↳29 QDP
↳30 UsableRulesProof (⇔, 0 ms)
↳31 QDP
↳32 QReductionProof (⇔, 8 ms)
↳33 QDP
↳34 QDPSizeChangeProof (⇔, 0 ms)
↳35 YES
↳36 PiDP
↳37 UsableRulesProof (⇔, 0 ms)
↳38 PiDP
↳39 PiDPToQDPProof (⇒, 0 ms)
↳40 QDP
↳41 QDPSizeChangeProof (⇔, 0 ms)
↳42 YES
↳43 PiDP
↳44 PiDPToQDPProof (⇒, 0 ms)
↳45 QDP
↳46 QDPOrderProof (⇔, 1300 ms)
↳47 QDP
↳48 DependencyGraphProof (⇔, 0 ms)
↳49 TRUE
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → U1_GA(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → SPLIT2_IN_GAA(.(X, .(Y, L1)), L3, L4)
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_GAA(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U5_GAA(L1, L2, L3, split0_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT0_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U6_GAA(L1, L2, L3, split1_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT1_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U7_GAA(L1, L2, L3, split2_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3, L5)
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_GA(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4, L6)
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_GA(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → MERGE_IN_GGA(L5, L6, L2)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U14_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_GGA(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U13_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_GGA(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → U1_GA(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → SPLIT2_IN_GAA(.(X, .(Y, L1)), L3, L4)
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_GAA(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U5_GAA(L1, L2, L3, split0_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT0_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U6_GAA(L1, L2, L3, split1_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT1_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U7_GAA(L1, L2, L3, split2_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3, L5)
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_GA(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4, L6)
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_GA(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → MERGE_IN_GGA(L5, L6, L2)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U14_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_GGA(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U13_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_GGA(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
From the DPs we obtained the following set of size-change graphs:
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
From the DPs we obtained the following set of size-change graphs:
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U9_GGA(X, L1, Y, L2, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2))
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U11_GGA(X, L1, Y, L2, gt_in_gg(X, Y))
U11_GGA(X, L1, Y, L2, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2)
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U14_gg(x0, x1, x2)
U13_gg(x0, x1, x2)
U11_GGA(X, L1, Y, L2, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2)
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
POL(.(x1, x2)) = 2·x1 + x2
POL(0) = 2
POL(MERGE_IN_GGA(x1, x2)) = 2·x1 + 2·x2
POL(U11_GGA(x1, x2, x3, x4, x5)) = 2·x1 + 2·x2 + 2·x3 + 2·x4 + x5
POL(U13_gg(x1, x2, x3)) = 2·x1 + 2·x2 + x3
POL(U14_gg(x1, x2, x3)) = x1 + x2 + x3
POL(U9_GGA(x1, x2, x3, x4, x5)) = x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5
POL(gt_in_gg(x1, x2)) = 2·x1 + 2·x2
POL(gt_out_gg(x1, x2)) = 1 + 2·x1 + x2
POL(le_in_gg(x1, x2)) = x1 + x2
POL(le_out_gg(x1, x2)) = x1 + x2
POL(s(x1)) = 2·x1
U9_GGA(X, L1, Y, L2, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2))
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U11_GGA(X, L1, Y, L2, gt_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U14_gg(x0, x1, x2)
U13_gg(x0, x1, x2)
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))
U9_GGA(X, L1, Y, L2, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U14_gg(x0, x1, x2)
U13_gg(x0, x1, x2)
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))
U9_GGA(X, L1, Y, L2, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U14_gg(x0, x1, x2)
U13_gg(x0, x1, x2)
gt_in_gg(x0, x1)
U13_gg(x0, x1, x2)
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))
U9_GGA(X, L1, Y, L2, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
U14_gg(x0, x1, x2)
From the DPs we obtained the following set of size-change graphs:
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)
SPLIT2_IN_GAA(.(X, .(Y, L1))) → SPLIT_IN_GAA(L1)
SPLIT_IN_GAA(L1) → SPLIT2_IN_GAA(L1)
From the DPs we obtained the following set of size-change graphs:
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4, L6)
MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → U1_GA(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3, L5)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
U1_GA(X, Y, L1, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L4, mergesort_in_ga(L3))
U2_GA(X, Y, L1, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4)
MERGESORT_IN_GA(.(X, .(Y, L1))) → U1_GA(X, Y, L1, split2_in_gaa(.(X, .(Y, L1))))
U1_GA(X, Y, L1, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3)
mergesort_in_ga([]) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1))) → U1_ga(X, Y, L1, split2_in_gaa(.(X, .(Y, L1))))
split2_in_gaa(.(X, .(Y, L1))) → U8_gaa(X, Y, L1, split_in_gaa(L1))
split_in_gaa(L1) → U5_gaa(L1, split0_in_gaa(L1))
split0_in_gaa([]) → split0_out_gaa([], [], [])
U5_gaa(L1, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1) → U6_gaa(L1, split1_in_gaa(L1))
split1_in_gaa(.(X, [])) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1) → U7_gaa(L1, split2_in_gaa(L1))
U7_gaa(L1, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L4, mergesort_in_ga(L3))
U2_ga(X, Y, L1, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L5, mergesort_in_ga(L4))
U3_ga(X, Y, L1, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, merge_in_gga(L5, L6))
merge_in_gga([], L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, []) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2)) → U9_gga(X, L1, Y, L2, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, merge_in_gga(L1, .(Y, L2)))
merge_in_gga(.(X, L1), .(Y, L2)) → U11_gga(X, L1, Y, L2, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, merge_in_gga(.(X, L1), L2))
U12_gga(X, L1, Y, L2, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
mergesort_in_ga(x0)
split2_in_gaa(x0)
split_in_gaa(x0)
split0_in_gaa(x0)
U5_gaa(x0, x1)
split1_in_gaa(x0)
U6_gaa(x0, x1)
U7_gaa(x0, x1)
U8_gaa(x0, x1, x2, x3)
U1_ga(x0, x1, x2, x3)
U2_ga(x0, x1, x2, x3, x4)
U3_ga(x0, x1, x2, x3, x4)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U14_gg(x0, x1, x2)
U9_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U13_gg(x0, x1, x2)
U11_gga(x0, x1, x2, x3, x4)
U12_gga(x0, x1, x2, x3, x4)
U10_gga(x0, x1, x2, x3, x4)
U4_ga(x0, x1, x2, x3)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
MERGESORT_IN_GA(.(X, .(Y, L1))) → U1_GA(X, Y, L1, split2_in_gaa(.(X, .(Y, L1))))
POL( U2_GA(x1, ..., x5) ) = 2x4 + 2
POL( mergesort_in_ga(x1) ) = 0
POL( [] ) = 0
POL( mergesort_out_ga(x1, x2) ) = max{0, -2}
POL( .(x1, x2) ) = 2x2 + 1
POL( U1_ga(x1, ..., x4) ) = 2x1 + 2x2 + x4 + 1
POL( split2_in_gaa(x1) ) = max{0, x1 - 1}
POL( U1_GA(x1, ..., x4) ) = 2x4 + 2
POL( U8_gaa(x1, ..., x4) ) = x4 + 1
POL( split_in_gaa(x1) ) = 2x1 + 1
POL( split2_out_gaa(x1, ..., x3) ) = x2 + x3
POL( U2_ga(x1, ..., x5) ) = x1 + x2 + 2x3 + 2x4 + 1
POL( U3_ga(x1, ..., x5) ) = max{0, x4 + x5 - 2}
POL( U4_ga(x1, ..., x4) ) = max{0, 2x1 + 2x2 + 2x3 + 2x4 - 1}
POL( merge_in_gga(x1, x2) ) = x1 + 2
POL( U7_gaa(x1, x2) ) = 2x2 + 1
POL( split_out_gaa(x1, ..., x3) ) = 2x2 + 2x3 + 1
POL( U5_gaa(x1, x2) ) = x2 + 1
POL( split0_in_gaa(x1) ) = 0
POL( U6_gaa(x1, x2) ) = 2x2 + 1
POL( split1_in_gaa(x1) ) = x1
POL( split0_out_gaa(x1, ..., x3) ) = x1 + 2x2 + 2x3
POL( split1_out_gaa(x1, ..., x3) ) = x2 + 2x3
POL( merge_out_gga(x1, ..., x3) ) = x3 + 2
POL( U9_gga(x1, ..., x5) ) = max{0, -1}
POL( le_in_gg(x1, x2) ) = 0
POL( U11_gga(x1, ..., x5) ) = max{0, x1 + 2x3 + 2x4 - 2}
POL( gt_in_gg(x1, x2) ) = 2x1 + 2
POL( s(x1) ) = 0
POL( U14_gg(x1, ..., x3) ) = max{0, 2x1 + x2 - 2}
POL( 0 ) = 2
POL( le_out_gg(x1, x2) ) = max{0, 2x1 + 2x2 - 1}
POL( U10_gga(x1, ..., x5) ) = 2x1 + x2 + 2x5 + 2
POL( U13_gg(x1, ..., x3) ) = max{0, 2x1 + 2x2 - 2}
POL( gt_out_gg(x1, x2) ) = max{0, x1 - 2}
POL( U12_gga(x1, ..., x5) ) = 2x1 + x3 + 2
POL( MERGESORT_IN_GA(x1) ) = 2x1 + 2
split2_in_gaa(.(X, .(Y, L1))) → U8_gaa(X, Y, L1, split_in_gaa(L1))
split_in_gaa(L1) → U7_gaa(L1, split2_in_gaa(L1))
U7_gaa(L1, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1) → U5_gaa(L1, split0_in_gaa(L1))
split_in_gaa(L1) → U6_gaa(L1, split1_in_gaa(L1))
U8_gaa(X, Y, L1, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
split0_in_gaa([]) → split0_out_gaa([], [], [])
U5_gaa(L1, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split1_in_gaa(.(X, [])) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U1_GA(X, Y, L1, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L4, mergesort_in_ga(L3))
U2_GA(X, Y, L1, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4)
U1_GA(X, Y, L1, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3)
mergesort_in_ga([]) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1))) → U1_ga(X, Y, L1, split2_in_gaa(.(X, .(Y, L1))))
split2_in_gaa(.(X, .(Y, L1))) → U8_gaa(X, Y, L1, split_in_gaa(L1))
split_in_gaa(L1) → U5_gaa(L1, split0_in_gaa(L1))
split0_in_gaa([]) → split0_out_gaa([], [], [])
U5_gaa(L1, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1) → U6_gaa(L1, split1_in_gaa(L1))
split1_in_gaa(.(X, [])) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1) → U7_gaa(L1, split2_in_gaa(L1))
U7_gaa(L1, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L4, mergesort_in_ga(L3))
U2_ga(X, Y, L1, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L5, mergesort_in_ga(L4))
U3_ga(X, Y, L1, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, merge_in_gga(L5, L6))
merge_in_gga([], L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, []) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2)) → U9_gga(X, L1, Y, L2, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, merge_in_gga(L1, .(Y, L2)))
merge_in_gga(.(X, L1), .(Y, L2)) → U11_gga(X, L1, Y, L2, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, merge_in_gga(.(X, L1), L2))
U12_gga(X, L1, Y, L2, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)
mergesort_in_ga(x0)
split2_in_gaa(x0)
split_in_gaa(x0)
split0_in_gaa(x0)
U5_gaa(x0, x1)
split1_in_gaa(x0)
U6_gaa(x0, x1)
U7_gaa(x0, x1)
U8_gaa(x0, x1, x2, x3)
U1_ga(x0, x1, x2, x3)
U2_ga(x0, x1, x2, x3, x4)
U3_ga(x0, x1, x2, x3, x4)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U14_gg(x0, x1, x2)
U9_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U13_gg(x0, x1, x2)
U11_gga(x0, x1, x2, x3, x4)
U12_gga(x0, x1, x2, x3, x4)
U10_gga(x0, x1, x2, x3, x4)
U4_ga(x0, x1, x2, x3)